#include "Gfx.h"
#include "GameController.h"
#include "BootStrap.h"
#include "ResourceMgr.h"
#include <time.h>
#include <stdlib.h>

int main (int argc, char **argv) {
	srand(time(0));

	// The game controller knows all the game components
	GameController *gctrl = GameController::instance();

	// Initializes SDL prior to setting up a display
	Gfx *gfx = Gfx::instance();

  //#ifdef __DARWIN__
	gfx->init(1024, 768, 0, GFX_FULLSCREEN);
  //#else
  //gfx->init(1024, 768, 0, GFX_WINDOWED);
  //#endif

	// Initialize the resource manager
	ResourceMgr *rmgr = ResourceMgr::instance();
	rmgr->setRootPath("./data");

	// The bootstrap is a dummy game component
	// whose purpose is both to register all
 // the game components and to launch the first
	// real game component (example: the splash screen)
	// The whole game execution is then managed by
	// the game components themselves.
	BootStrap *bs = BootStrap::instance();
	bs->start();

  // NOTE:
  // The last game component "Halt"
  // will kill all the singletons and free memory
  // as expected.
}

